package com.module.app.base.loadsir;

import android.content.Context;
import android.view.View;

import com.kingja.loadsir.callback.Callback;
import com.module.app.R;


/**
 * 加载中的动画
 */

public class LoadingCallback extends Callback {

    private boolean isDestroy;

    @Override
    protected int onCreateView() {
        return R.layout.app_layout_loadsir_loading;
    }

    @Override
    public boolean getSuccessVisible() {
        return super.getSuccessVisible();
    }

    @Override
    protected boolean onReloadEvent(Context context, View view) {
        return true;
    }

    protected void onViewCreate(Context context, View view) {

    }

    @Override
    public void onAttach(Context context, View view) {
        super.onAttach(context, view);
//        view.findViewById(R.id.loading).setVisibility(View.GONE);
//        view.postDelayed(new Runnable() {
//            @Override
//            public void run() {
//                if (isDestroy || view == null) {
//                    return;
//                }
//                view.findViewById(R.id.loading).setVisibility(View.VISIBLE);
//            }
//        }, 200);
    }

    @Override
    public void onDetach() {
        super.onDetach();
        isDestroy = true;
    }
}
